#include <stdio.h>
#include <unistd.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>

static void point_test();

static void test_switch(int);

int var_test(int count, ...);

int mystrlen(char *);

int get_array_size(char **pa);

int main_point() {
    printf("Hello, World!\n");


    char *a1 = "Hello";
    char *b1 = "world";
    char *c1 = "!";
    char *d1 = NULL;

    char *pa[] = {a1, b1, c1, d1};

    char **pa1 = pa;
    printf("%d\n", 5);
    printf("%d\n", get_array_size(pa1));
    printf("Helloworld\n");

    int const a = 15;
    printf("%d\n", a);

    int *pi;
    int const *pci;
    const int *pci1;

    int a_case = 5;

    char *mystring = "cahrsdasfasd";
    printf("%d\n", mystrlen(mystring));


    printf("可变参数\n");
    int va1 = 3;
    int va2 = 61;
    int va3 = 71;
    int va4 = 82;
    var_test(va1, va2, va3,va4);


    return 0;
}

static void test_switch(int a_case) {
    switch (a_case) {
        case 5:
            printf("%d\n", a_case);
            break;
        default:
            printf("default");
    }
}

static void point_test() {
    int size_t;
}

int mystrlen(char *string) {
    int size_t = 0;
    char *tmp = string;
    while (*tmp++ != '\0') {
        size_t++;
    }
    return size_t;
}

int get_array_size(char **pa) {
    char *string = NULL;
    int count = 0;
    while ((string = *pa++) != NULL)

        while (*string++ != '\0') {
            count++;
        }
    return count;
}

int var_test(int count, ...) {

    va_list varg;

    int count1;

    va_start(varg,count);
    for (int i = 0; i < count; i++) {
        int my = va_arg(varg, int);
        printf("%d\n", my);
    }
    va_end(varg);
}




























